from rest_framework import serializers
from app01 import models

class CameraSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Camera
        fields = ['camera_id', 'location', 'dangerous_behavior_video', 'gps_location']
    def to_representation(self, instance):
        representation = super().to_representation(instance)
        representation['status'] = True  # 你可以根据需要设置这个字段的值
        return representation    
from rest_framework import serializers
import app01.models 

class CameraEventSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.CameraEvent
        fields = ['timestamp','behavior','illegal_items','camera_id']  